export default {
  // 数字滚动动画
  numberGrow(ele,num) {
    const time = 1; // 时间
    let step = (num * 10) / (time * 100);
    let current = 0;
    let start = 0;
    let fun = function (){
      start += step;
      if (start >= num) {
        start = num;
      }else {
        setTimeout(fun,10);
      }
      if (current === start) {
        return;
      }
      current = parseInt(start) ;
      // console.log(current);
      if (current && ele) {
        ele.innerText = current.toString().replace(/(\d)(?=(?:\d{3}[+]?)+$)/g, "$1");
      }
    }
    fun();
  }
}
